package com.course.design.controller;

import com.course.design.common.Result;
import com.course.design.entity.UserFriends;
import com.course.design.service.FriendService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述:
 *
 * @author qinlianji
 * @create 2020-03-07
 */
@Api(tags = "好友")
@RestController
@RequestMapping("/friend")
public class FriendsController {

    @Autowired
    private FriendService friendService;

    @PostMapping("/save")
    @Transactional(rollbackFor = Exception.class)
    public Result save(UserFriends vo){
        friendService.save(vo);
        return Result.success(vo);
    }
}
